package com.lawyer.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.lawyer.entity.LawyerCaseInfo;
import com.lawyer.model.Message;
import com.lawyer.repository.LawyerCaseInfoRepository;

@RestController
@RequestMapping(value = "/lawyerCaseInfo")
@Api(tags = "案例相关")
@SuppressWarnings("all")
public class LawyerCaseInfoController {

	protected final Logger logger = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private LawyerCaseInfoRepository lawyerCaseInfoRepository;
	
	
	@ApiOperation(httpMethod = "GET", value = "案例详情", notes = "案例详情")
	@RequestMapping(value = "/info", method = RequestMethod.GET)
	public HttpEntity<?> info(Long id) {
		Message msg = new Message();
		LawyerCaseInfo info = lawyerCaseInfoRepository.findOne(id);
		msg.setData(info);
		return new ResponseEntity<>(msg, HttpStatus.OK);
	}
	
}
